<template>
  <div class="cust-base-info">
    <el-form
      ref="custFormBaseInfoRef"
      :model="custFormBaseFormData"
      :label-position="labelPosition"
      label-width="100px"
      :rules="rules"
    >
      <more-panel mode="1" title="身份证信息">
        <el-col :span="4" slot="fixed"
          ><div class="grid-content bg-purple">
            <div class="demo-image__placeholder">
              <div class="block" style="text-align:center;">
                <el-image v-if="!src" fit="scale-down" :src="require('@/assets/imgs/wjz.jpg')"  class="img">                                                 
                </el-image>
                <el-image v-else fit="scale-down" :src="src"  class="img">                                                
                </el-image>
              </div>
            </div></div
        ></el-col>
        <el-col :span="20" slot="fixed"
          ><div class="grid-content bg-purple">
            <div>
              <h3 class="u-title">
                {{ customerName }}
              </h3>
              <el-row :gutter="6">
                <el-col
                  :span="8"
                  v-for="(item, index) in dataArr[0]"
                  :key="index"
                >
                  <el-col :span="10" class="u-name">{{ item.name }}：</el-col>
                  <el-col :span="14" class="u-value">
                  <span> {{ item.value }}</span>
                  </el-col>
                </el-col>
              </el-row>
            </div>
          </div>
        </el-col>
        <el-col :span="20" :offset="4">
          <el-row :gutter="6">
            <el-col :span="8" v-for="(item, index) in dataArr[1]" :key="index">
              <el-col :span="10" class="u-name">{{ item.name }}：</el-col>
              <el-col :span="14" class="u-value">{{ item.value }}</el-col>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="20" :offset="4">
          <el-row :gutter="6">
            <el-col :span="16" v-for="(item, index) in dataArr[2]" :key="index">
              <el-col :span="5" class="u-name">{{ item.name }}：</el-col>
              <el-col :span="19" class="u-value">{{ item.value }}</el-col>
            </el-col>
          </el-row>
        </el-col>
      </more-panel>
      <div class="m-contain">
        <el-row class="form-block">
          <el-col class="ne-title" :span="24">
            <p class="base-title title-left"><span>客户基本信息</span></p>
            <div>
              <el-row :gutter="24">
                <el-col :span="6">
                  <el-form-item label="营销责任地" class="u-ipt" required>
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.regionName"
                      class="input-with-select"
                      disabled
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item label="客户经理" class="u-ipt" required prop="customerManager">
                    <dic-customer-select
                      :value="custFormBaseFormData.customerManager"
                      title="客户经理"
                      :withHeader="false"
                      ref="customerManagerRef"
                      size="70%"
                      lock-scroll
                      @inLoadAjax="customerManagerAjax"
                      @closeDialog="closeDialog"
                    >
                      <div class="m-title">
                        <span class="icon"></span> 员工列表
                      </div>
                      <el-form
                        ref="employeesListFormDataRef"
                        :model="employeesListFormData"
                        label-position="left"
                        label-width="80px"
                      >
                        <el-row :gutter="10">
                          <el-col :span="6">
                            <div class="grid-content bg-purple">
                              <el-form-item label="员工编码" class="u-ipt">
                                <el-input
                                  placeholder=""
                                  v-model="employeesListFormData.custCode"
                                  class="input-with-select"
                                >
                                </el-input>
                              </el-form-item>
                            </div>
                          </el-col>
                          <el-col :span="6">
                            <div class="grid-content bg-purple">
                              <el-form-item label="员工名称" class="u-ipt">
                                <el-input
                                  placeholder="请输入内容"
                                  v-model="employeesListFormData.custName"
                                  class="input-with-select"
                                >
                                </el-input>
                              </el-form-item>
                            </div>
                          </el-col>
                          <el-col :span="6">
                            <div class="grid-content bg-purple">
                              <el-form-item label="组织名称" class="u-ipt">
                                <el-input
                                  placeholder="请输入内容"
                                  v-model="employeesListFormData.orgName"
                                  class="input-with-select"
                                >
                                </el-input>
                              </el-form-item>
                            </div>
                          </el-col>
                          <el-col :span="4">
                            <el-button
                              type="primary"
                              size="small"
                              @click="employeesListQuery(1)"
                              >查询</el-button
                            >
                            <el-button
                              type="primary"
                              size="small"
                              @click="chooseHandel"
                              >选择</el-button
                            >
                          </el-col>
                        </el-row>
                      </el-form>
                      <el-table
                        ref="employeesListTableRef"
                        :data="employeesListTableData"
                        border
                        :header-cell-style="{
                          background: '#F2F2F2',
                          color: '#333',
                        }"
                        tooltip-effect="dark"
                        style="width: 100%"
                        @selection-change="handleSelectionChange"
                      >
                        <el-table-column type="selection" width="55">
                        </el-table-column>
                        <el-table-column
                          label="员工编码"
                          width="120"
                          prop="STAFF_CODE"
                        >
                        </el-table-column>
                        <el-table-column
                          prop="STAFF_NAME"
                          label="员工名称"
                          width="120"
                        >
                        </el-table-column>
                        <el-table-column
                          prop="ORG_NAME"
                          label="组织名称"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                        <el-table-column
                          prop="DEPARTMENT_NAME"
                          label="部门名称"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                        <el-table-column
                          prop="mobilePhone"
                          label="移动电话"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                      </el-table>
                      <el-pagination
                        background
                        @size-change="employeesListTablePageHandleSizeChange"
                        @current-change="
                          employeesListTablePageHandleCurrentChange
                        "
                        :current-page="parseInt(employeesListTablePage.pageIndex)"
                        :page-size="parseInt(employeesListTablePage.pageSize)"
                        layout="total, prev, pager, next, jumper"
                        :total="parseInt(employeesListTablePage.rowCount)"
                        class="m-pagination"
                      >
                      </el-pagination>
                      <div class="m-title">
                        <span class="icon"></span> 已选择列表
                        <el-button
                          type="primary"
                          size="small"
                          @click="delManner"
                          >删除</el-button
                        >
                      </div>
                      <el-table
                        class="table-box"
                        ref="employeesSelectedListTableRef"
                        :data="employeesSelectedListTableData"
                        border
                        :header-cell-style="{
                          background: '#F2F2F2',
                          color: '#333',
                        }"
                        tooltip-effect="dark"
                        style="width: 100%"
                        @selection-change="
                          employeesSelectedListHandleSelectionChange
                        "
                      >
                        <el-table-column type="selection" width="55">
                        </el-table-column>
                        <el-table-column
                          label="员工编码"
                          width="120"
                          prop="STAFF_CODE"
                        >
                        </el-table-column>
                        <el-table-column
                          prop="STAFF_NAME"
                          label="员工名称"
                          width="120"
                        >
                        </el-table-column>
                        <el-table-column
                          prop="ORG_NAME"
                          label="组织名称"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                        <el-table-column
                          prop="DEPARTMENT_NAME"
                          label="部门名称"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                        <el-table-column
                          prop="mobilePhone"
                          label="移动电话"
                          show-overflow-tooltip
                        >
                        </el-table-column>
                      </el-table>
                    </dic-customer-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="细分市场"
                    class="u-ipt"
                    prop="custMktSegmentCdName"
                  >
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.custMktSegmentCdName"
                      class="input-with-select"
                      disabled
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item label="客户类别" class="u-ipt" prop="custKind">
                    <el-select
                      v-model="custFormBaseFormData.custKind"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[0]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <load-city
                    :cityName="cityName"
                    :address="address"
                    @func="getAddress"
                    ref="loadCity"
                  ></load-city>
                </el-col>
                <el-col :span="12">
                  <el-form-item
                    label="详细地址"
                    prop="detailAddress"
                    required
                  >
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.detailAddress"
                      class="input-with-select"
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="客户性质"
                    prop="custPropertyValue"
                  >
                    <el-select
                      v-model="custFormBaseFormData.custPropertyValue"
                      @change="custTypeHandel"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[1]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6" v-if="roles == 0 ? false:true">
                  <el-form-item
                    label="直管类型"
                    prop="controlType"
                    required
                  >
                    <el-select
                      v-model="custFormBaseFormData.controlType"
                      @change="custTypeHandel"
                      class="m-select"
                      :disabled='gkDisabled'
                    >
                      <el-option
                        v-for="item in selectInfo[6]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6" v-if="roles == 0 ? false:true">
                  <el-form-item
                    label="管控级别"
                    prop="controlLevel"
                    required
                  >
                    <el-select
                      v-model="custFormBaseFormData.controlLevel"
                      @change="custTypeHandel"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[7]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="客户服务等级"
                    prop="custServiceLevel"
                  >
                    <el-select
                      v-model="custFormBaseFormData.custServiceLevel"
                      placeholder="请选择"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[3]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="客户售后服务等级"
                    prop="custAfterSalesServiceLevel"
                  >
                    <el-select
                      v-model="custFormBaseFormData.secrecyLevel"
                      placeholder="请选择"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[2]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <contry-or-provice
                    :cityName="contryName"
                    :address="contryAddress"
                    :required="false"
                    @func="getcontry"
                  ></contry-or-provice>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="省行业经理"
                    prop="proIndustryManagerValue"
                  >
                    <dic-customer-select
                      :value="chooseProManagerPage.STAFF_NAME"
                      title="省行业经理"
                      :withHeader="false"
                      ref="dicCustomerSelect"
                      size="70%"
                      @inLoadAjax="proIndustryManagerAjax"
                    >
                      <el-form
                        ref="proIndustryManagerFormRef"
                        :model="proIndustryManagerFormData"
                        :label-position="labelPosition"
                        label-width="80px"
                      >
                        <el-row :gutter="10">
                          <el-col :span="5">
                            <el-form-item
                              label="员工编码"
                              class="u-ipt"
                              prop="custCode"
                            >
                              <el-input
                                placeholder=""
                                v-model="proIndustryManagerFormData.custCode"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="员工姓名"
                              class="u-ipt"
                              prop="custName"
                            >
                              <el-input
                                placeholder=""
                                v-model="proIndustryManagerFormData.custName"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="组织名称"
                              class="u-ipt"
                              prop="orgName"
                            >
                              <el-input
                                placeholder=""
                                v-model="proIndustryManagerFormData.orgName"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="手机号码"
                              class="u-ipt"
                              prop="mobileNumber"
                            >
                              <el-input
                                placeholder=""
                                v-model="
                                  proIndustryManagerFormData.mobileNumber
                                "
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="4">
                            <el-button
                              type="primary"
                              size="small"
                              @click="employeesListQuery(2)"
                              >查询</el-button
                            >
                          </el-col>
                        </el-row>
                        <el-table
                          v-if="showManerP"
                          :data="proIndustryManagerTable"
                          ref="localNetworkManageRef"
                          border
                          :header-cell-style="{
                            background: '#F2F2F2',
                            color: '#333',
                          }"
                          @row-click="proIndustryManagerDialogRow"
                          class="proIndustryManager-table"
                        >
                          <el-table-column property="STAFF_CODE" label="员工编码">
                          </el-table-column>
                          <el-table-column
                            property="STAFF_NAME"
                            label="员工名称"
                          >
                          </el-table-column>
                          <el-table-column property="ORG_NAME" label="组织名称">
                          </el-table-column>
                          <el-table-column
                            property="DEPARTMENT_NAME"
                            label="部门名称"
                          >
                          </el-table-column>
                          <el-table-column
                            property="telNumber"
                            label="移动电话"
                          >
                          </el-table-column>
                        </el-table>
                        <el-pagination
                          v-if="showManerP"
                          background
                          @size-change="handleSizeChange"
                          @current-change="proHandleCurrentChange"
                          :current-page="parseInt(proIndustryManagerPage.pageIndex)"
                          :page-size="parseInt(proIndustryManagerPage.pageSize)"
                          layout="total, prev, pager, next, jumper"
                          :total="parseInt(proIndustryManagerPage.rowCount)"
                          class="m-pagination"
                        >
                        </el-pagination>
                      </el-form>
                      <div class="checkMan" v-if="!showManerP">
                        请输入查询条件
                      </div>
                    </dic-customer-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="本地行业经理"
                    prop="proIndustryManagerValue"
                  >
                    <dic-customer-select
                      :value="chooseLocalManagerPage.STAFF_NAME"
                      title="本地行业经理"
                      :withHeader="false"
                      ref="localNetworkManager"
                      size="70%"
                      @inLoadAjax="localNetworkManagerAjax"
                    >
                      <el-form
                        ref="proIndustryManagerFormRef"
                        :model="localNetworkManagerFormData"
                        :label-position="localNetworkManagerFormLabelPosition"
                        label-width="80px"
                      >
                        <el-row :gutter="10">
                          <el-col :span="5">
                            <el-form-item
                              label="员工编码"
                              class="u-ipt"
                              prop="custCode"
                            >
                              <el-input
                                placeholder=""
                                v-model="localNetworkManagerFormData.custCode"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="员工姓名"
                              class="u-ipt"
                              prop="custName"
                            >
                              <el-input
                                placeholder=""
                                v-model="localNetworkManagerFormData.custName"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="组织名称"
                              class="u-ipt"
                              prop="orgName"
                            >
                              <el-input
                                placeholder=""
                                v-model="localNetworkManagerFormData.orgName"
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="5">
                            <el-form-item
                              label="手机号码"
                              class="u-ipt"
                              prop="mobileNumber"
                            >
                              <el-input
                                placeholder=""
                                v-model="
                                  localNetworkManagerFormData.mobileNumber
                                "
                                class="input-with-select"
                              >
                              </el-input>
                            </el-form-item>
                          </el-col>
                          <el-col :span="4">
                            <el-button
                              type="primary"
                              size="small"
                              @click="employeesListQuery(3)"
                              >查询</el-button
                            >
                          </el-col>
                        </el-row>
                        <el-table
                          v-if="showManerL"
                          :data="localNetworkManageTable"
                          ref="localIndustryManager"
                          border
                          :header-cell-style="{
                            background: '#F2F2F2',
                            color: '#333',
                          }"
                          @row-click="localNetworkManagerDialogRow"
                          class="proIndustryManager-table"
                        >
                          <el-table-column property="STAFF_CODE" label="员工编码">
                          </el-table-column>
                          <el-table-column
                            property="STAFF_NAME"
                            label="员工名称"
                          >
                          </el-table-column>
                          <el-table-column property="ORG_NAME" label="组织名称">
                          </el-table-column>
                          <el-table-column
                            property="DEPARTMENT_NAME"
                            label="部门名称"
                          >
                          </el-table-column>
                          <el-table-column
                            property="telNumber"
                            label="移动电话"
                          >
                          </el-table-column>
                        </el-table>
                        <el-pagination
                          v-if="showManerL"
                          background
                          @size-change="handleSizeChange"
                          @current-change="handleCurrentChange"
                          :current-page="parseInt(LocalIndustryManagerPage.pageIndex)"
                          :page-size="parseInt(LocalIndustryManagerPage.pageSize)"
                          layout="total, prev, pager, next, jumper"
                          :total="parseInt(LocalIndustryManagerPage.rowCount)"
                          class="m-pagination"
                        >
                        </el-pagination>
                      </el-form>
                      <div class="checkMan" v-if="!showManerL">
                        请输入查询条件
                      </div>
                    </dic-customer-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="企业员工数"
                    prop="personNum "
                  >
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.personNum"
                      class="input-with-select"
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="经办人名称"
                    class="u-ipt"
                    prop="certificationPersion"
                  >
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.certificationPersion"
                      class="input-with-select"
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item
                    label="经办人证件类型"
                    class="u-ipt"
                    prop="idType"
                  >
                    <el-select
                      v-model="custFormBaseFormData.idType"
                      placeholder="请选择"
                      class="m-select"
                    >
                      <el-option
                        v-for="item in selectInfo[4]['val']"
                        :key="item.code"
                        :label="item.name"
                        :value="item.code"
                      >
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
                <el-col :span="6">
                  <el-form-item label="经办人证件号码" class="u-ipt" prop="idNumber">
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.idNumber"
                      class="input-with-select"
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="经办人证件地址" class="u-ipt" prop="idAddress">
                    <el-input
                      placeholder="请输入内容"
                      v-model="custFormBaseFormData.idAddress"
                      class="input-with-select"
                    >
                    </el-input>
                  </el-form-item>
                </el-col>
              </el-row>
            </div>
          </el-col>
        </el-row>
      </div>
      <div class="button-sx-f clearfix">
        <el-button type="primary" class="comit_Btn" plain @click="comitBtn()"
          >提交</el-button
        >
        <el-button type="primary" class="cancel_Btn" plain @click="cancelBtn()"
          >取消</el-button
        >
      </div>
    </el-form>
  </div>
</template>

<script>
import MorePanel from "@/components/public/MorePanel/MorePanelCust";
import DicCustomerSelect from "@/components/customer/form/DicCustomerSelect";
import CustomerInfoManageServer from "@/api/customer/CustomerInfoManageServer";
import loadCity from "@/components/public/loadCity";
import ContryOrProvice from "@/components/public/loadCity/ContryOrProvice";
import { mapState } from "vuex";
import validRules from "@/views/customer/valide/validRules.js";
export default {
  name: "modifyBasicInfo",
  data() {
    return {
      src:"",
      dataArr: [
        [
          {
            name: "统一社会信用代码",
            value: "",
            flag: "0",
          },
          {
            name: "证件类型",
            value: "",
            flag: "0",
          },
          {
            name: "证件号码",
            value: "",
            flag: "0",
          },
          {
            name: "身份证类型",
            value: "",
            flag: "0",
          },
          {
            name: "身份证编码",
            value: "",
            flag: "0",
          },
          {
            name: "身份证有效期",
            value: "",
            flag: "0",
          },
          {
            name: "客户简称",
            value: "",
            flag: "0",
          },
          {
            name: "机构类型",
            value: "",
            flag: "0",
          },
          {
            name: "行业类型",
            value: "",
            flag: "0",
          },
        ],
        [
          {
            name: "登记管理部门名称",
            value: "",
            flag: "0",
          },
          {
            name: "经济行业类型",
            value: "",
            flag: "0",
          },
          {
            name: "经济类型",
            value: "",
            flag: "0",
          },
          {
            name: "法定代表人姓名",
            value: "",
            flag: "0",
          },
          {
            name: "注册资本",
            value: "",
            flag: "0",
          },
          {
            name: "成立日期",
            value: "",
            flag: "0",
          },
          {
            name: "发照日期",
            value: "",
            flag: "0",
          },
          {
            name: "经营状态",
            value: "",
            flag: "0",
          },
          {
            name: "发证机关",
            value: "",
            flag: "0",
          },
          {
            name: "生产经营地址",
            value: "",
            flag: "0",
          },
          {
            name: "注册地址",
            value: "",
            flag: "0",
          },
        ],
        [
          {
            name: "经营范围",
            value: "",
            flag: "0",
          },
        ],
      ],
      rules:{
        customerManager:[
          { required: true, message: "请选择客户经理", trigger: ["blur","change"] },
        ],
        detailAddress: [
          { required: true, message: "请输入详细地址", trigger: "blur" },
          {
            min: 10,
            max: 80,
            message: "详细地址长度应在 10 到 80 个字符",
            trigger: "blur",
          },
        ],
        controlType:[
          { required: true, message: "请选择直管类型", trigger: "change" },
        ],
        controlLevel:[
           { required: true, message: "请选择管控级别", trigger: "change" },
        ],
        idType:[
          { validator: validRules.cx_edit_idType, trigger: "change" },
        ],
        idNumber:[
          {validator: validRules.cx_edit_idNumber, trigger: "blur" }
        ],
        certificationPersion:[
          {validator: validRules.cx_edit_certificationPersion, trigger: "blur" }
        ],
        idAddress:[
          {validator: validRules.cx_edit_idAddress, trigger: "blur" }
        ]

      },
      defaultProps: {
        children: "children",
        label: "industryTypeName",
      },
      defaultShowNodes: [], // 这里存放要默认展开的节点 id
      activeName: "baseInfo",
      tabPosition: "left",
      custFormBaseFormData: {
        // 营销责任地code值
        regionId: "",
        // 营销责任地名称
        regionName: "",
        //客户经理
        customerManager: "",
        //客户经理ID
        customerManagerId:'',
        // 细分市场的code值
        custMktSegmentCd: "",
        // 细分市场名称
        custMktSegmentCdName: "",
        //  客户类型选中值
        custKind: "",
        //  客户性质选中值-没有
        custPropertyValue: "",
        // 直管类型值
        controlType: "",
        // 管控级别选中值
        controlLevel: "",
        //  客户地址-没有
        custAddress: "",
        // 详细地址-没有
        detailAddress: "",
        // 客户服务等级
        custServiceLevel: "",
        // 客户售后服务等级
        secrecyLevel: "",
        // 售后服务等级名字
        secrecyLevelName: "",
        // 总部所在国家选中值
        headquarterCountry: "",
        // 总部所在国家的名字
        headCountryName: "",
        // 省行业经理选中值
        custManagerNameS: "",
        // 本地行业经理
        custManagerNameD: "",
        // 企业员工数
        personNum: "",
        //经办人名称
        certificationPersion: "",
        // 证件类型
        idType: "",
        // 证件号码
        idNumber: "",
        // 证件地址
        idAddress: "",
      },
      labelPosition: "left",
      //  本地行业经理
      localNetworkManagerFormData: {
        // 员工编码
        custCode: "",
        // 员工姓名
        custName: "",
        // 组织名称
        orgName: "",
        // 手机号码
        mobileNumber: "",
      },
      //省选中的客户经理信息
      chooseProManagerPage: {
        STAFF_ID: "",
        STAFF_NAME: "",
      },
      //本地选中的客户经理信息
      chooseLocalManagerPage: {
        STAFF_ID: "",
        STAFF_NAME: "",
      },
      //  本地行业经理label位置
      localNetworkManagerFormLabelPosition: "left",
      // 行业经理
      localNetworkManageTable: [
        {
          custCode: "员工编码",
          custName: "员工名称",
          organizationName: "组织名称",
          departmentName: "部门名称",
          telNumber: "手机号码",
        },
        {
          custCode: "员工编码",
          custName: "员工名称",
          organizationName: "组织名称",
          departmentName: "部门名称",
          telNumber: "手机号码",
        },
      ],
      // 客户经理表格分页
      LocalIndustryManagerPage: {
        pageIndex: 1, //当前页码
        pageSize: 5, //每页多少条
        rowCount: 10, //总条数
        pageCount: 10, //总页数
      },
      // 省行业经理弹窗
      proIndustryManagerFormData: {
        // 员工编码
        custCode: "",
        // 员工姓名
        custName: "",
        // 组织名称
        orgName: "",
        // 手机号码
        mobileNumber: "",
      },
      // 省行业经理-表头
      proIndustryManagerTable: [
        {
          custCode: "员工编码",
          custName: "员工名称",
          organizationName: "组织名称",
          departmentName: "部门名称",
          telNumber: "手机号码",
        },
        {
          custCode: "员工编码",
          custName: "员工名称",
          organizationName: "组织名称",
          departmentName: "部门名称",
          telNumber: "手机号码",
        },
      ],

      // 省行业经理--分页
      proIndustryManagerPage: {
        pageIndex: 1,
        pageSize: 5,
        totalResult: 0,
      },

      // 客户经理-员工列表-表单双向数据绑定
      employeesListFormData: {
        custCode: "", //员工编码
        custName: "", //员工名称
        orgName: "", //组织名称
      },
      //客户经理-员工列表-表格数据-员工列表
      employeesListTableData: [
      ],
      selectionManner: [], //选中的客户经理
      delselectManner: [], //删除已选中的客户经理
      //客户经理-员工列表-表格数据-员工列表-分页
      employeesListTablePage: {
        pageIndex: 1, //当前页码
        pageSize: 5, //每页多少条
        rowCount: 10, //总条数
        pageCount: 10, //总页数
      },
      // 客户经理已选员工列表
      employeesSelectedListTableData: [],
      cityName: "客户地址",
      address: { county: "26068", provice: "", city: "", area: "" }, //城市
      customerName: "",
      contryName: "总部所在国家",
      contryAddress: { county: "" }, //国家
      chooseAddress: {}, //地址对象
      selectInfo: [
        {
          flag: "cust_kind", //客户类别
          val: [],
        },
        {
          flag: "enterprise_kind", //客户性质
          val: [],
        },
        {
          flag: "secrecy_level", //售后服务等级
          val: [],
        },
        {
          flag: "service_level", //客户服务等级
          val: [],
        },
        {
          flag: "cert_type_s", //证件类型（修改客户、新建客户填报）
          val: [],
        },
        {
          flag: "tax_province_code", //省列表
          val: [],
        },
        {
          flag: "control_type", //直管类型
          val: [],
        },
        {
          flag: "control_level", //管控级别
          val: [],
        },
      ],
      showManerP: false,
      showManerL: false,
      channelMemberId: "", //回显的客户经理id
      channelMemberIdP: "", //回显的省行业经理id
      channelMemberIdC: "", //回显的市行业经理id
      roles:'',//客户运营岗
      oldPartyCode:'',//客户编码
      gkDisabled:false,//管控级别是否可选
    };
  },
  components: {
    MorePanel,
    DicCustomerSelect,
    loadCity,
    ContryOrProvice,
  },
  created() {},
  mounted() {
    this.$nextTick(() => {
      // 身份证信息初始化
      this.initGetPartyNews();
      //初始化下拉框
      this.initSelect();
      //客户经理列表
      this.getManagerList();
      // 客户基本信息初始化
      this.initCustomerInfo();
      this.checkIsOperate();
    });
  },
  computed: {
    ...mapState("user", ["user"]),
  },
  methods: {
    // 初始化信息接口
    async initGetPartyNews() {
      let params = {
        partyId: this.$route.query.partyId,
        staffId: this.user.staffId,
      };
      const response = await CustomerInfoManageServer.initGetPartyNews(params);
      if (response.code == 200) {
        let result = response.meta;
        
        this.getPhoto(result.party.partyCert.photoPath)
        //客户名称
        this.customerName = result.party.partyName;
        // 统一社会信用代码
        this.dataArr[0][0].value = this.isNull(result.party.partyCert.orgUscc);
        // 证件类型
        this.dataArr[0][1].value = this.isNull(
          result.party.partyCert.certTypeName
        );
        //  证件号码
        this.dataArr[0][2].value = this.isNull(result.party.partyCert.certNum);
        // 身份证类型
        this.dataArr[0][3].value = this.isNull(result.party.identityTypeName);
        // 身份证编码
        this.dataArr[0][4].value = this.isNull(result.party.partyNbr);
        // 身份证有效期
        this.dataArr[0][5].value = this.format(
          this.isNull(result.party.idExpDate)
        );
        // 客户简称
        this.dataArr[0][6].value = this.isNull(result.party.partyAbbrname);
        // 机构类型
        this.dataArr[0][7].value = this.isNull(
          result.party.partyOrg.orgPropertyName
        );
        // 行业类型
        this.dataArr[0][8].value = this.isNull(
          result.party.partyOrg.industryName
        );
        // 登记管理部门名称
        this.dataArr[1][0].value = this.isNull(
          result.party.partyOrg.registerOrg
        );
        // 经济类型
        this.dataArr[1][2].value = this.isNull(
          result.party.partyOrg.econTypeName
        );
        //法定代表人姓名
        this.dataArr[1][3].value = this.isNull(result.party.partyOrg.legalRepr);
        //注册资本
        this.dataArr[1][4].value = this.isNull(result.party.partyOrg.orgAssets);
        //成立日期
        this.dataArr[1][5].value = this.format(
          this.isNull(result.party.partyOrg.custBuildDate)
        );
        //发照日期
        this.dataArr[1][6].value = this.format(
          this.isNull(result.party.partyCert.issuedate)
        );
        //经营状态
        this.dataArr[1][7].value = this.isNull(
          result.party.partyOrg.busiStatusCdName
        );
        //发证机关
        this.dataArr[1][8].value = this.isNull(result.party.partyOrg.certorg);
        //生产经营地址
        this.dataArr[1][9].value = this.isNull(result.party.partyOrg.orgAddr);
        //注册地址生产经营地址
        this.dataArr[1][10].value = this.isNull(
          result.party.partyOrg.registerAddr
        );
        //经营范围
        this.dataArr[2][0].value = this.isNull(result.party.partyOrg.busiScope);
      }
    },
    //获取证件照片
    async getPhoto(path){
      if(path){
        const response = await CustomerInfoManageServer.getCustPhoto({photoPath:path});
        if(response.code == 200){
           this.src = response.meta.base64
        }
      }else {
        this.src = ''
      }
    },
    // 客户基本信息初始化
    async initCustomerInfo() {
      let params = {
        custId: this.$route.query.custId,
        staffId: this.user.staffId,
        scope:
          "customer,custAssignRel,custOther,custCertification,serviceGrade,partyOrg",
      };
      const response = await CustomerInfoManageServer.initCustDetail(params);
      if (response.code == 200) {
        
        let res = response.meta.customerDetail;
        this.oldPartyCode = res.oldPartyCode
        // 营销责任地code值
        this.custFormBaseFormData.regionId = res.regionId;
        // 营销责任地名称
        this.custFormBaseFormData.regionName = res.regionName;
        // 细分市场名称
        this.custFormBaseFormData.custMktSegmentCdName = this.isNull(
          res.marketName
        );
        this.custFormBaseFormData.custMktSegmentCd = this.isNull(
          res.marketId
        );
        res.custAssignRel.forEach((item) => {
          if (item.responsibilityTypeCd == 4) {
            //客户经理A
            // this.custFormBaseFormData.customerManagerId = item.channelMemberId;
            // this.custFormBaseFormData.customerManager = item.custManagerName;
            this.custFormBaseFormData.customerManagerId =
              this.custFormBaseFormData.customerManagerId +
              (this.custFormBaseFormData.customerManagerId.length != 0
                ? "," + this.isNull(item.channelMemberId)
                : this.isNull(item.channelMemberId));
            this.custFormBaseFormData.customerManager =
             this.custFormBaseFormData.customerManager +
              (this.custFormBaseFormData.customerManager.length != 0
                ? ";" + this.isNull(item.custManagerName)
                : this.isNull(item.custManagerName));
          } else if (item.responsibilityTypeCd == 5) {
            //客户经理B
            this.custFormBaseFormData.customerManagerId =
              this.custFormBaseFormData.customerManagerId +
              (this.custFormBaseFormData.customerManagerId.length != 0
                ? "," + this.isNull(item.channelMemberId)
                : this.isNull(item.channelMemberId));
            this.custFormBaseFormData.customerManager =
             this.custFormBaseFormData.customerManager +
              (this.custFormBaseFormData.customerManager.length != 0
                ? ";" + this.isNull(item.custManagerName)
                : this.isNull(item.custManagerName));
          } else if (item.responsibilityTypeCd == 9) {
            //省行业经理
            this.chooseLocalManagerPage.STAFF_NAME = item.custManagerName;
            this.chooseLocalManagerPage.STAFF_ID = item.channelMemberId;
          } else if (item.responsibilityTypeCd == 10) {
            //本地行业经理
            this.chooseProManagerPage.STAFF_NAME = item.custManagerName;
            this.chooseProManagerPage.STAFF_ID = item.channelMemberId;
          }
        });
        this.custFormBaseFormData.controlType = res.custOther[0] ? this.isNull(
          res.custOther[0].controlType
        ) : ''; //管控级别
        this.gkDisabled = this.custFormBaseFormData.controlType ? true:false; //管控级别是否可选
        this.custFormBaseFormData.controlLevel = res.custOther[0] ? this.isNull(
          res.custOther[0].controlLevel
        ) : ''; //直管类型
        this.custFormBaseFormData.industryTypeId = this.isNull(
          res.industryTypeId
        ); //行业类型
        this.custFormBaseFormData.custKind = this.isNull(res.custKind); //客户类别
        this.custFormBaseFormData.custPropertyValue = this.isNull(
          res.partyOrg.enterpriseKind
        ); //客户性质
        this.address.county = this.isNull(res.country)
          ? parseInt(this.isNull(res.country))
          : ""; //国家
        this.address.provice = this.isNull(res.province)
          ? parseInt(this.isNull(res.province))
          : this.isNull(res.province); //省
        this.address.city = this.isNull(res.city)
          ? parseInt(this.isNull(res.city))
          : this.isNull(res.city); //城市
        this.address.area = this.isNull(res.county)
          ? parseInt(this.isNull(res.county))
          : this.isNull(res.county); //县
        this.custFormBaseFormData.detailAddress = this.isNull(res.custAddr); //详细地址
        this.custFormBaseFormData.custServiceLevel = this.isNull(
          res.serviceGrade ? res.serviceGrade.serviceLevel : ""
        ); //客户服务等级
        this.custFormBaseFormData.secrecyLevel = this.isNull(res.secrecyLevel); //客户售后等级
        this.contryAddress.county = res.custOther[0] ? this.isNull(res.custOther[0].headCountry) ? Number(this.isNull(res.custOther[0].headCountry)):this.isNull(res.custOther[0].headCountry) : ''; //客户所在国家
        this.custFormBaseFormData.headquarterCountry = res.custOther[0] ? this.isNull(res.custOther[0].headCountry):'';
        this.custFormBaseFormData.personNum = res.custOther[0] ? this.isNull(
          res.custOther[0].personNum
        ) : ''; //企业员工数
        this.custFormBaseFormData.certificationPersion = this.isNull(
          res.custCertification ? res.custCertification.certificationPersion : ''
        ); //经办人名称
        this.custFormBaseFormData.idType = this.isNull(
          res.custCertification ? res.custCertification.certificationType : ''
        ); //证件类型
        this.custFormBaseFormData.idNumber = this.isNull(
          res.custCertification ? res.custCertification.certificationNumber : ''
        ); //证件号码
        this.custFormBaseFormData.idAddress = this.isNull(
          res.custCertification ? res.custCertification.certificationAddress :''
        ); //证件地址
        this.getAddressInfo();
        this.checkManager();
        //
      }
    },
    //判断当前登录人是否为客户运营岗
    async checkIsOperate(){
      const response = await CustomerInfoManageServer.checkIsOperate({sysUserId:this.user.sysUserId});
      if(response.code == 200){
          this.roles = response.meta.roles
          if(this.custFormBaseFormData.controlType){
            if(this.custFormBaseFormData.controlType!='13006001'){
              if(this.roles > 1){
                this.remove('13006001'); 				
              }
            }
            if (this.custFormBaseFormData.controlType!='13006002'){
              if(this.roles > 2){
                  this.remove('13006002');  
              }
            }
            if (this.custFormBaseFormData.controlType!='13006003'){
              if(this.roles > 3){
                  this.remove('13006003');  
              }
            }
          }
      }
    },
    //移除数组的某一项
    remove(value){
      var array = this.selectInfo[7].val;
      array.filter(function (item,index) {
          if(value == item.code){
            array.splice(index, 1)
          }
      })
    },
    getAddressInfo() {
      if (this.address.provice) {
        this.$refs.loadCity.selectProvice();
      }
      if (this.address.city) {
        this.$refs.loadCity.selectCity();
      }
    },
    //查询客户经理用于初始化显示
    async checkManager() {
      if (this.custFormBaseFormData.customerManagerId) {
        let response = await CustomerInfoManageServer.getStaffList({
          STAFF_ID: this.custFormBaseFormData.customerManagerId,
        });
        if (response.code == 200) {
          this.selectionManner = response.meta.customers;
          this.employeesSelectedListTableData = response.meta.customers;
        }
      }
      this.custFormBaseFormData.customerManagerId = this.custFormBaseFormData.customerManagerId.split(',').join(';')
    },
    //初始化下拉框
    initSelect() {
      let response = "";
      this.selectInfo.forEach(async (item, index) => {
        response = await CustomerInfoManageServer.initValue({
          flag: item.flag,
        });
        if (response.code == 200) {
          this.selectInfo[index].val = response.meta.customers;
        }
      });
    },
    //初始化客户经理列表
    async getManagerList() {
      const response = await CustomerInfoManageServer.getManagerList({
        pageIndex: 1,
        pageSize: 5,
        STAFF_CODE: this.employeesListFormData.custCode,
        STAFF_NAME: this.employeesListFormData.custName,
        ORG_NAME: this.employeesListFormData.orgName,
        ORG_ID:this.user.orgId
      });
      if (response.code == 200) {
        this.employeesListTablePage.rowCount = response.meta.pageInfo.rowCount
        this.employeesListTableData = response.meta.customers;
      }
    },

    // 判断值是否存在
    isNull(val) {
      if (
        val == "NaN" ||
        val == "null" ||
        val == "undefined" ||
        val == undefined
      ) {
        return (val = "");
      } else {
        return val;
      }
    },
    // 格式化日期文件
    format(val) {
      if (val) {
        // var time = new Date(parseInt(val));
        // var y = time.getFullYear();
        // var m = time.getMonth()+1;
        // var d = time.getDate();
        var y = val.substring(0, 4);
        var m = val.substring(4, 6);
        var d = val.substring(6, 8);
        // return y+'-'+this.add0(m)+'-'+this.add0(d);
        return y + "-" + m + "-" + d;
      } else {
        return val;
      }
    },
    // add0(m){ return m<10 ? '0'+m:m },
    //   行业类型弹窗
    handleTree(data) {
      
      // 
      this.custFormBaseFormData.industryCd = data.industryTypeName;
      // 获取行业类型的code
      this.custFormBaseFormData.industryTypeCode = data.industryTypeId;

      this.$refs.industryCdRef[0].drawer = false;
    },
    // 客户类别下拉框选择方法
    custKindNameHandel(Val) {
      
      this.custFormBaseFormData.custKind = Val;
      
    },
    custTypeHandel(val) {
      
      
    },
    //

    // 省行业经理弹窗数据交互
    proIndustryManagerAjax() {},
    // 本地网行业经理
    localNetworkManagerAjax() {},
    // 行业类型
    industryCdAjax() {
      
    },
    // 行业经理
    localNetworkManageDialogRow(val) {
      this.custFormBaseFormData.custManagerNameD = val.custName;
      // 
      this.$refs.localNetworkManagerRef.drawer = false;
    },
    // 本地行业经理
    handleSizeChange() {},
    handleCurrentChange() {
      this.LocalIndustryManagerPage.pageIndex = val;
      this.employeesListQuery(3,'change');
    },
      // 省行业经理
    proHandleCurrentChange (val){
      this.proIndustryManagerPage.pageIndex = val;
      this.employeesListQuery(2,'change');
    },
    //省行业经理点击行
    proIndustryManagerDialogRow(val) {
      
      this.chooseProManagerPage = val;
      this.$refs.dicCustomerSelect.drawer = false;
    },
    //本地行业经理选中
    localNetworkManagerDialogRow(val) {
      this.chooseLocalManagerPage = val;
      this.$refs.localNetworkManager.drawer = false;
    },
    // 客户经理ajax初始化
    customerManagerAjax() {},
    // 客户经理 -选择方法
    chooseHandel() {
      if (
        this.selectionManner.length +
          this.employeesSelectedListTableData.length >
        2
      ) {
        this.$alert("客户经理最多只能选择2个", "提示", { type: "warning" });
      } else {
        if (this.employeesSelectedListTableData.length == 0) {
          this.selectionManner.forEach((el,index) => {
            if(index == 0){
              this.employeesSelectedListTableData.push(el);
            }else {
              if(this.employeesSelectedListTableData[0].ORG_ID == el.ORG_ID){
                 this.employeesSelectedListTableData.push(el);
              }else {
                this.employeesSelectedListTableData = [];
                this.$alert('客户经理必须为同一组织', "提示", {
                    type: "warning",
                  });
                
              }
            }
          });
        } else {
          this.employeesSelectedListTableData.forEach((item) => {
            if (item.STAFF_ID == this.selectionManner[0].STAFF_ID) {
              this.$alert(`${item.STAFF_NAME}已被添加，不能重复添加`, "提示", {
                type: "warning",
              });
            }else if(item.ORG_ID != this.selectionManner[0].ORG_ID){
                this.$alert('客户经理必须为同一组织', "提示", {
                  type: "warning",
                });
            } else {
              this.selectionManner.forEach((el) => {
                this.employeesSelectedListTableData.push(el);
              });
            }
          });
        }
      }
    },
    // 客户经理-查询方法
    async employeesListQuery(val,type) {
      let params;
      if (val == 1) {
        params = {
          pageIndex: type == 'change' ? this.employeesListTablePage.pageIndex : 1,
          pageSize: "5",
          STAFF_CODE: this.employeesListFormData.custCode,
          STAFF_NAME: this.employeesListFormData.custName,
          ORG_NAME: this.employeesListFormData.orgName,
          ORG_ID:this.user.orgId
        };
      } else if (val == 2) {
        params = {
          pageIndex: type == 'change' ? this.proIndustryManagerPage.pageIndex : 1,
          pageSize: "5",
          STAFF_CODE: this.proIndustryManagerFormData.custCode,
          STAFF_NAME: this.proIndustryManagerFormData.custName,
          ORG_NAME: this.proIndustryManagerFormData.orgName,
          ORG_ID:this.user.orgId,
          flag:1
        };
      } else if (val == 3) {
        params = {
          pageIndex: type == 'change' ? this.LocalIndustryManagerPage.pageIndex : 1,
          pageSize: "5",
          STAFF_CODE: this.localNetworkManagerFormData.custCode,
          STAFF_NAME: this.localNetworkManagerFormData.custName,
          ORG_NAME: this.localNetworkManagerFormData.orgName,
          ORG_ID:this.user.orgId,
          flag:1
        };
      }
      const response = await CustomerInfoManageServer.getManagerList(params)
      if (response.code == 200) {
        if (val == 1) {
          this.employeesListTablePage.pageIndex = type == 'change' ? this.employeesListTablePage.pageIndex : 1;
          this.employeesListTablePage.rowCount = response.meta.pageInfo.rowCount;
          this.employeesListTableData = response.meta.customers;
        } else if (val == 2) {
          this.showManerP = true;
          this.proIndustryManagerPage.pageIndex = type == 'change' ? this.proIndustryManagerPage.pageIndex : 1;
          this.proIndustryManagerPage.rowCount = response.meta.pageInfo.rowCount;
          this.proIndustryManagerTable = response.meta.customers;
        } else if (val == 3) {
          this.showManerL = true;
          this.LocalIndustryManagerPage.pageIndex = type == 'change' ? this.LocalIndustryManagerPage.pageIndex : 1;
          this.LocalIndustryManagerPage.rowCount = response.meta.pageInfo.rowCount;
          this.localNetworkManageTable = response.meta.customers;
        }
      }
    },
    // 客户经理-员工列表-分页方法
    employeesListTablePageHandleSizeChange(val) {
      
    },
    // 客户经理-员工列表-当前页
    employeesListTablePageHandleCurrentChange(val) {
      this.employeesListTablePage.pageIndex = val;
      this.employeesListQuery(1,'change');
    },
    // 客户经理-员工列表-点击复选框触发的事件
    handleSelectionChange(val) {
      this.selectionManner = val;
    },
    // 客户经理-已选员工列表-点击复选框触发的事件
    employeesSelectedListHandleSelectionChange(val) {
      // 
      this.delselectManner = val;
      
    },
    //删除客户经理
    delManner() {
      if (this.delselectManner.length == 2) {
        this.employeesSelectedListTableData = [];
      } else {
        this.employeesSelectedListTableData.forEach((item, index) => {
          this.delselectManner.forEach((item1) => {
            if (item.STAFF_ID == item1.STAFF_ID) {
              this.employeesSelectedListTableData.splice(index, 1);
            }
          });
        });
      }
    },
    //关闭客户经理弹窗带回客户经理
    closeDialog() {
      this.custFormBaseFormData.customerManager = "";
      this.custFormBaseFormData.customerManagerId = "";
      this.employeesSelectedListTableData.forEach((item, index) => {
        this.custFormBaseFormData.customerManager =
          index == 0 && this.employeesSelectedListTableData.length == 2
            ? this.custFormBaseFormData.customerManager +
              item.STAFF_NAME +
              ";"
            : this.custFormBaseFormData.customerManager + item.STAFF_NAME;
        this.custFormBaseFormData.customerManagerId =
          index == 0 && this.employeesSelectedListTableData.length == 2
            ? this.custFormBaseFormData.customerManagerId +
              item.STAFF_ID +
              ";"
            : this.custFormBaseFormData.customerManagerId + item.STAFF_ID;
      });
    },
    getAddress(val) {
      
      this.chooseAddress = val;
    },
    getcontry(val) {
      
      this.custFormBaseFormData.headquarterCountry = val.county;
    },
    // 取消
    confirmHandel() {
      this.$router.push("/custbaseinf");
    },
    // 初始化表单列表
    async getList(params) {
      //获取页面下拉框值
      const result = await CustomerInfoManageServer.initValue(params);
      
      return result;
    },
    //修改信息完成保存接口
    async comitBtn() {
      this.$refs.custFormBaseInfoRef.validate((valid) => {
        if (valid) {
          this.saveEditInfo();
        } else {
          return false;
        }
      });
    },
    async saveEditInfo(){
      let typeArr = ['1','2','3','4','12','14','41','42','50']
      if(this.custFormBaseFormData.idType && typeArr.indexOf(this.custFormBaseFormData.idType) == -1){
        this.$alert('经办人证件类型有误，请重新选择！', "提示", {
          type: "warning",
          center: true,
        });
        return
      }
      let params = {
        oldPartyCode:this.oldPartyCode,//客户编码
        custId: this.$route.query.custId, //客户主键
        partyId: this.$route.query.partyId, //参与人主键
        regionId: this.custFormBaseFormData.regionId, //营销责任地
        staffId: this.$route.query.staffId, //用户
        custManageIdAB: this.custFormBaseFormData.customerManagerId, //客户经理
        custMktSegmentCd:this.custFormBaseFormData.custMktSegmentCd,//细分市场
        industryTypeId: this.custFormBaseFormData.industryTypeId, //行业类型
        custKind: this.custFormBaseFormData.custKind, //客户类别
        enterpriseKind: this.custFormBaseFormData.custPropertyValue, //客户性质
        country: this.chooseAddress.county, //国
        province: this.chooseAddress.provice, //省
        city: this.chooseAddress.city, //市
        county: this.chooseAddress.area, //县
        custAddr: this.custFormBaseFormData.detailAddress, //详细地址
        serviceLevel: this.custFormBaseFormData.custServiceLevel, //客户服务等级
        secrecyLevel: this.custFormBaseFormData.secrecyLevel, //售后服务等级
        headCountry: this.custFormBaseFormData.headquarterCountry, //总部所在国家
        custManageIdS: this.chooseProManagerPage.STAFF_ID, //省行业经理
        custManageIdD: this.chooseLocalManagerPage.STAFF_ID, //本地网行业经理
        personNum: this.custFormBaseFormData.personNum, //企业员工数
        controlType: this.custFormBaseFormData.controlType, //直管类型
        controlLevel: this.custFormBaseFormData.controlLevel, //管控级别
        certificationPersion: this.custFormBaseFormData.certificationPersion, //经办人名称
        certificationType: this.custFormBaseFormData.idType, //证件类型
        certificationNumber: this.custFormBaseFormData.idNumber, //证件号码
        certificationAddress: this.custFormBaseFormData.idAddress, //证件地址
        orgId:this.user.orgId,
        regionType:this.user.regionType,
        regionCode:this.user.regionCode,
      };
      let loadingInstance = this.$loading({ fullscreen: true });
      const result = await CustomerInfoManageServer.updateCustNews(params);
      loadingInstance.close();
      if (result.code == 200) {
        if (result.meta.resultCode == 0) {
          this.$confirm("信息保存成功", "提示", {
            confirmButtonText: "确定",
            showCancelButton: false,
            type: "success",
            center: true,
          })
            .then(() => {
              this.$router.push({
                path: "/custbaseinf",
              });
            })
            .catch(() => {});
        }else {
          this.$message({
            showClose: true,
            message: result.meta.resultMsg,
            type: 'error'
          });
        }
      }
    },
    //取消按钮返回客户列表页
    cancelBtn() {
      this.$router.push({
        path: "/custbaseinf",
        query: {},
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.title-left {
  span {
    font-size: $fontSize_v2;
    font-weight: 600;
    position: relative;
    color: $textColor1;
    padding-left: 0.08rem;
    &::before {
      content: "";
      border-left: 0.03rem solid #f56d39;
      display: inline-block;
      position: absolute;
      left: 0;
      top: 9%;
      height: 78%;
    }
  }
}
.button-sx-f {
  width: 100%;
  margin: 0 auto 0;
  text-align: center;
  background-color: rgba(255, 255, 255, 1);
  padding: 0 0 0px 0;
  position: fixed;
  bottom: 0rem;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  left: 0;
  right: 0;
  box-shadow: 0px 10px 14px 10px rgba(0, 0, 0, 0.1);
}

.cust-base-info {
  background: #fff;
  padding: 10px 20px;
}

.form-block {
  margin-top: 0 !important;
}

.m-cascader {
  width: 100%;
}

.m-title {
  // margin-bottom: 10px;
  height: 0.4rem;
  line-height: 0.4rem;
  color: #0052d9;
  font-size: 12px;
}

.m-box {
  background-color: rgba(221, 221, 221, 0.2);
  padding: 13px;
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
}

.m-title .icon {
  float: left;
  display: block;
  width: 4px;
  height: 12px;
  background: #f56f3c;
  margin-top: 0.12rem;
  margin-right: 0.1rem;
  font-size: 0.14rem;
}

.img {
  height: 200px;
}

.u-name {
  text-align: right;
  font-size: 13px;
  padding: 5px 0;
  color: #333;
  line-height: 0.4rem;
}

.u-value {
  text-align: left;
  font-size: 13px;
  padding: 5px 0;
  color: #333;
  line-height: 0.4rem;
}

.contain {
  background: #fff;
  color: #333;
}

.u-title {
  font-size: 0.18rem;
  color: #333;
  margin-left: 30px;
  margin-bottom: 10px;
  font-weight: 600;
}

.m-contain {
  margin: 20px 0;
}

.base-title {
  line-height: 0.5rem;
}

.m-select {
  width: 100%;
}

.select {
  margin-right: 10px;
}
.table-box {
  margin-bottom: 0.2rem;
}
.el-dialog__body {
  margin-top: 0;
}
.m-tree-box {
  min-height: 4rem;
  overflow-y: auto;
}
.comit_Btn {
  width: 60px;
  margin-right: 10px;
}
.cancel_Btn {
  width: 60px;
}
.m-title button {
  float: right;
  margin-right: 20px;
  height: 0.2rem;
}
.m-pagination {
  margin-top: 10px;
}
.checkMan {
  text-align: center;
  color: red;
  font-size: 20px;
}
</style>
